/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.facade.main.controller;

import com.alibaba.fastjson.JSONObject;
import com.facade.main.httpunit.HttpHelper;
import com.facade.main.httpunit.HttpProperty;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author Administrator
 */
@RestController
public class StoreController {
    //查询门店订单
    @RequestMapping(value = "/store", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public String storeOrder(@RequestBody JSONObject json, @RequestParam("erp_store_id")String erp_store_id, @RequestParam("order_no") String order_no,@RequestParam("order_date")String order_date){
        String querString = String.format("order_no=%s&order_date=%s", order_no, order_date);
        String url = String.format("%s/store/%s/orders?%s", HttpProperty.TESTURL,erp_store_id,querString);
        return HttpHelper.postData(url, json.toJSONString(), querString);
    }
}
